<% layout('layout/layout') %>
<% block('header').append(`<style>
</style>`)%>
<div class="row">
  <div class="col-xs-12">
    <div class="box">
      <div class="box-header">
        <h3 class="box-title"><%=title %></h3>
        <div class="box-tools">
          <!--<a class="btn  btn-sm btn-success" href="add"><%=title %></a>-->
          <!--<div class="input-group input-group-sm" style="width: 150px;">-->
          <!--<input type="text" name="table_search" class="form-control pull-right" placeholder="Search">-->

          <!--<div class="input-group-btn">-->
          <!--<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>-->
          <!--</div>-->
          <!--</div>-->
        </div>
      </div>
      <!-- /.box-header -->
      <div class="box-body table-responsive no-padding">
        <table class="table table-bordered table-hover">
          <tbody>
          <tr>
            <th>订单Id</th>
            <th>商品图片</th>
            <th>订单状态</th>
            <th>商品总额</th>
            <th>邮费</th>
            <th>应付总额</th>
            <th>下单时间</th>
            <th>支付时间</th>
            <th>操作</th>
          </tr>
          <%  orders.forEach(function(item){ %>
          <tr>
            <td width="100"><%=item.orderId %></td>
            <td>
              <% item.goods.forEach(function(goods){ %>
              <div style="width:80px;width:80px;display:inline-block">
                <img src="<%=goods.imgTmb %>" style="max-width:100%;" >
              </div>
              <% }) %>
            </td>
            <td class="<%=item.statusColor%>" >
              <%=item.statusName %>
              <% if(item.refunding === 2) { %>
              <p class="text-danger fs12" style="font-size:12px;">用户退款申请</p>
              <% }%>
            </td>
            <td class="text-center">￥<%=item.totalPrice%></td>
            <td class="text-center">￥<%=item.feePrice %></td>
            <td class="text-center" style="font-weight:bold;" >￥<%=item.needPrice%></td>
            <td><%=item.create_at_ago() %></td>
            <td><%=item.pay_at_ago() %></td>
            <td><p><a href="<%=assetsPath %>/orders/detail/<%=item._id %>">订单详情</a></p></td>
          </tr>
          <% })%>
          </tbody>

        </table>
      </div>
      <!-- /.box-body -->
    </div>
    <!-- /.box -->
    <div class="j_pager" data-page="<%=page %>"  data-count="<%=count%>"></div>
  </div>

</div>
<% block('footer').append(`<script src="${assetsPath}/js/uploadImg.js"></script>`); %>
<% block('footer').append(`<script src="${assetsPath}/js/pager.js" ></script>`); %>
<% block('footer').append(`<script>
$('.j_pager').pager();
</script>`)%>